<script type="text/javascript">
  var docheckpsstat='__URL__/docheckpsstat';
  var docheckpsstatandaddvolume='__URL__/docheckpsstatandaddvolume';
</script>
<div class="col-md-12 col-xs-12"><a class='btn btn-info' href='__URL__/query'>返回</a></div>
<?php foreach($psls as $pso){ ?>
  <div class="col-md-3 col-xs-3 panel panel-default">
    <div class="panel-body" style="padding:0px">

      <div class='col-md-12 col-xs-12'>
        <div class='col-md-2 col-xs-2'></div>
        <div class='col-md-8 col-xs-8' style="text-align:center"><h3>{$pso['linefull']}</h3></div>
        <div class='col-md-2 col-xs-2'></div>

      </div>

      <div class="col-md-12 col-xs-12 panel panel-default nopadding">
        <div class="panel-body" style="padding0px;font-size:10px">
          <!--<div >SKU:{$pso['partnm']}&nbsp;包材码:{$pso['partcode']}&nbsp;{$bancio['bancinm']}&nbsp;{$tm}</div>-->
          <div><h4 style="margin-top:0px;margin-bottom:0px">包材码:{$pso['partcode']}</h4></div>
        </div>
      </div>

      <?php
      $zong=$pso['psvolume'];$already=$pso['psalready'];$remain=$zong-$already;
      $alreadyshengchanpercent=round($pso['planrealvolume']/$pso['planvolumebox']*100,2).'%';
      $alreadypercent=round(($already/$zong-$pso['planrealvolume']/$pso['planvolumebox'])*100,2).'%';
      $remainpercent=(100-round($already/$zong*100,2)).'%';
      ?>

      <style type="text/css">.slot{height:30px;}</style>
      <div class="col-md-12 col-xs-12 panel panel-default">
        <div class="panel-body" style='padding:0px'>
          <div class="col-md-12 col-xs-12 nopadding"><div class="col-md-3 col-xs-3 nopadding"></div><div class="col-md-9 col-xs-9 nopadding" ><div style="text-align:right;width:100%">{$zong}/100%</div></div></div>
          <div class="col-md-12 col-xs-12 nopadding"><div class="col-md-3 col-xs-3 nopadding" >总订单</div><div class="col-md-9 col-xs-9 nopadding" ><div style="background-color:#5bc0de;height:30px;width:100%"></div></div></div>
          <div class="col-md-12 col-xs-12 nopadding"><div class="col-md-3 col-xs-3 nopadding"></div><div class="col-md-9 col-xs-9 nopadding"><div style="text-align:right;width:{$alreadypercent}">{$already}/{$alreadypercent}</div></div></div>
          <div class="col-md-12 col-xs-12 nopadding"><div class="col-md-3 col-xs-3 nopadding">已运送</div><div class="col-md-9 col-xs-9 nopadding"><div class='pull-left' style="background-color:#ccf93a;height:30px;width:{$alreadyshengchanpercent}"></div><div class='pull-left'  style="background-color:#5bc0de;height:30px;width:{$alreadypercent}"></div></div></div>
          <div class="col-md-12 col-xs-12 nopadding"><div class="col-md-3 col-xs-3 nopadding"></div><div class="col-md-9 col-xs-9 nopadding"><div class='pull-right' style="text-align:left;width:{$remainpercent}">{$remain}/{$remainpercent}</div></div></div>
          <div class="col-md-12 col-xs-12 nopadding"><div class="col-md-3 col-xs-3 nopadding">剩余订单量</div><div class="col-md-9 col-xs-9 nopadding"><div class='pull-right' style="background-color:#337ab7;height:30px;width:{$remainpercent}"></div></div></div>
        </div>
      </div>

      <div class="col-md-12 col-xs-12 panel panel-default">
        <div class="panel-body" style="padding:0px">
        <?php if($pso['yuzhistat']=='success'){ $clr='#5cb85c'; }else if($pso['yuzhistat']=='warning'){ $clr='#f0ad4e'; }else{ $clr='#c9302c'; } ?>
          <div class="col-md-12 col-xs-12 nopadding"><div class="col-md-4 col-xs-4 nopadding">线边实时库存</div><div class="col-md-8 col-xs-8 nopadding" style="background-color:{$clr};text-align:center;color:#fff">{$pso['xianbiantm']}</div></div>
        </div>
      </div>

      <div class="col-md-12 col-xs-12 panel panel-default">
        <div class="panel-body" style="padding:0px">
          <div class="col-md-12 col-xs-12 nopadding"><div class="col-md-5 col-xs-5 nopadding" style="background-color:#f0ad4e">stock bottle:{$pso['partvolumeperpa']}</div><div class="col-md-2 col-xs-2 nopadding"></div><div class="col-md-5 col-xs-5 nopadding" style="background-color:#f0ad4e;text-align:center">Take time:{$yuzhio['yuzhitaketime']} min</div></div>
          
        </div>
      </div>
      <style>
      .danger{width: 25px;height:25px;background-color: #c9302c;border-radius: 50%}
      .success{width: 25px;height:25px;background-color: #5cb85c;border-radius: 50%}
      .warning{width: 25px;height:25px;background-color: #f0ad4e;border-radius: 50%}
      </style>
      <div class="col-md-12 col-xs-12 panel panel-default">
        <div class="panel-body">
          <div class="col-md-12 col-xs-12"><div class="col-md-6 col-xs-6"><div class="{$pso['yuzhistat']}" style='margin:0 auto;'></div></div><div class="col-md-6 col-xs-6" class='background-color:#5cb85c'>{$pso[psstatnm]}</div></div>
        </div>
      </div>
    </div>
  </div>
<?php } ?>

<script type="text/javascript">
$(function(){
  var obj=new Object();
  obj['psid']={$pso['psid']};
  $('#chexiao').click(function(){
    $.ajax({
        'type': 'GET',
        'url':docheckpsstat,
        'async':false,  
        'contentType': 'application/json',
        'data': obj,
        'dataType': 'json',
        'success': function(data) {
          window.location.href='__URL__/query';
          console.log("success");
        },
        'error':function() {
            console.log("error");
        }
    });
  })

  $('#complete').click(function(){
    obj['peisongliang']=$('#peisongliang').val();
    $.ajax({
        'type': 'GET',
        'url':docheckpsstatandaddvolume,
        'async':false,  
        'contentType': 'application/json',
        'data': obj,
        'dataType': 'json',
        'success': function(data) {
          window.location.href='__URL__/query';
          console.log("success");
        },
        'error':function() {
            console.log("error");
        }
    });
  })
    
  
})
  
</script>
